home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Education
/
World of Education.iso
/
world_p
/
pcshx10b.zip
/
PCSHX10B.EXE
/
GNUFGREP.EXE
/
GREPDOCS.EXE
/
FEATURES.DOS
< prev
next >
Wrap
Text File
|
1990-09-06
|
3KB
|
82 lines
FEATURES OF THESE MSDOS VERSIONS OF GNU E?GREP AND FGREP
--------------------------------------------------------
UN*X-style wildcards
Command line arguments are expanded in a fashion much closer
to UN*X conventions than to MSDOS conventions. The only real
difference from UN*X is in the treatment of backslashes.
Backslashes are equivalent to forward slashes. (MSDOS file
names cannot contain `*', `?', `[', or `]', and `[abc\-xyz]'
can be rewritten as `[-abcxyz]', so the loss of the backslash
escape is not serious.)
GNU glob.c is used to implement this feature.
GNU getopt
Because I use GNU getopt, the programs are very lenient about
where you place option flags on the command line.
`-d expr' option
This option is equivalent to the `-e expr' option, except that
any surrounding single or double quotes are stripped off
the expression. For instance,
egrep * -d 'foo'bar'
searches all files in the working directory for lines
with the string "foo'bar" in them. If you use double quotes
you have to backslash escape them to get them past the
Microsoft startup code, which uses double quotes for argument
grouping. Thus you might write
grep * -d \"foobar.*\"
to check all files in the working directory for lines containing
the string `foobar.*'.
The latter example points out the reason for including the `-d'
option. If you write
grep * -e foobar.*
or even
grep * -e "foobar.*"
the `foobar.*' might be expanded and mess up the command.
If you use an MSDOS `sh' then you shouldn't ever need the `-d'
option, but if you use COMMAND.COM, 4DOS, or the like
you might want to use it.
True byte count
Some versions of GNU (e?|f)grep programs for MSDOS read the input
in DOS text mode. When you use these versions with the `-b' option
every instance of `\r\n' is counted as a _single_ byte. I don't
consider this result to be kosher. My MSDOS versions read the
input in binary mode and compute true byte counts.
(For the curious: fgrep retains the `\r\n' sequences internally,
but e?grep converts them to `\n'. The byte count is made correct
by assigning each each internal character a weight. All characters
get a weight of 1, except for `\n' characters that were originally
`\r\n' sequences; these get a weight of 2. The byte count is
computed as a sum of weights.)
Long line and byte counters
The counters used by the `-b' and `-n' options are long integers,
so you won't see `3' when you ought to see `65539'.
-- Barry Schwartz, 6 Sept. 1990